import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
// 录入列表
function getEntryList(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getList`,
      method: 'post',
      data
  });
}
// 删除录入模板
function deleteTemplate(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/deleteSyllabusById`,
      method: 'post',
      data
  });
}
// 录入获取模板
function getTemplate(data) {
  return fetch({
      url: `${baseUrl}/templateManagementPost/previewTemplateByTime`,
      method: 'get',
      data
  });
}
// 录入获取模板(新)
function getTemplateNew(data) {
  return fetch({
      url: `${baseUrl}/templateManagementPost/previewTemplateByTimeEntry?code=` + data.code + "&&calendarId=" + data.calendarId,
      method: 'get',
      data
  });
}
// 录入保存/提交
function entryAddSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/saveSyllabus`,
      method: 'post',
      data
  });
}
// 编辑保存/提交
function entryUpdataSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/editSyllabus`,
      method: 'post',
      data
  });
}
// 从已审核完成数据来的 编辑保存/提交
function adminEditSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/adminEditSyllabus`,
      method: 'post',
      data
  });
}
// 根据id查数据
function getTemplateById(id) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getSyllabusById?id=${id}`,
      method: 'get'
  });
}
// 复制 根据code&calendarId获取已审核教学大纲
function getSyllabusByCode(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getSyllabusByCode`,
      method: 'post',
      data
  });
}
// 复制 （新）
function getSyllabusByCodeAllCalendar(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getSyllabusByCodeAllCalendar`,
      method: 'post',
      data
  });
}
// 编辑提交
function submitWorkFlow(data) {
  return fetch({
      url: `${baseUrl}/postApprove/submitWorkFlow`,
      method: 'post',
      data
  });
}
// 学科专业委员会主任数据
function getMajorList(code) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getMajorList?code=${code}`,
      method: 'post'
  });
}
// 指定审核人数据
function getMajorMembers(code) {
  return fetch({
      url: `${baseUrl}/syllabusEntry/getMajorMembers?code=${code}`,
      method: 'post'
  });
}

// 指定审核人数据(新)
function getAuditTeacherName(data) {
  return fetch({
      url: `${baseUrl}/auditTeacher/getAuditTeacherName`,
      method: 'post',
      data
  });
}
const postgraduateEntryApi = {
  getEntryList,
  deleteTemplate,
  getTemplate,
  getTemplateNew,
  entryAddSyllabus,
  entryUpdataSyllabus,
  adminEditSyllabus,
  getTemplateById,
  getSyllabusByCode,
  submitWorkFlow,
  getMajorList,
  getMajorMembers,
  getSyllabusByCodeAllCalendar,
  getAuditTeacherName
}
export default postgraduateEntryApi;
